<template>
	<view @click="isinfo=false,isyangshen=false,ismsmic=false,isCamera=false">
		<view class="flex-ju-b pt20">
			<view v-show="iscide&&yindex==0" class="posiab  bg2c2c2c top200 zindex150 colorfff right100 pg20 ra15">
				<scroll-view scroll-y style="max-height:1000rpx;" class=" scroll-view" v-if="mlist.length">
					<view style="min-width: 550rpx;" class="posire mt20 bg121212  pg20">
						<view class="flex-ju-b mb10">
							<view class="flex-a-i">
								<image mode="widthFix" v-if="voice" class="image width50 mr10"
									src="/static/metting/rails.png"></image>
			
				
								<image mode="widthFix" @click="onVoice" v-else class="image width50 mr10"
				
									src="/static/metting/rail.png"></image>


								<image mode="widthFix" v-if="voice_video" class="image width50 mr10"
									src="/static/metting/das.png"></image>
								<image mode="widthFix" @click="onVoiceVideo" v-else class="image width50 mr10"
									src="/static/metting/da.png">
								</image>

								<image mode="widthFix" v-if="voice_video_all" class="image width50 "
									src="/static/metting/lines.png"></image>
								<image mode="widthFix" @click="onVoiceeVideoAll" v-else class="image width50 mr10"
									src="/static/metting/line.png">
								</image>
							</view>
							<image @click="isquanvideo=true,iscide=false" mode="widthFix" class="image width50 mr10"
								src="/static/metting/expand.png"></image>
						</view>
						<view class="size28 mt10">正在讲话:{{speaking}}</view>
						<view class="pg20" v-show="voice_video||voice_video_all" :class="voice_video?'voice-video':''">

							<view v-if="video_list.length" v-for="(item,index) in video_list"
								@mousedown="onVideoTab(item)" :key="index" class="colorfff bg000 mt30 width700 posire ">
								<view v-if="item.local_camera" class="videocls height350 flex-ju-c">
									<view class="posire">
										<image mode="widthFix" class="image mb20 wh120-120" src="/static/img/xaing.png">
										</image>
										<image mode="widthFix" v-if="item.role=='chair'"
											class="image wh40-40 posiab bottom10 right0"
											src="/static/img/chaungjian.png">
										</image>
									</view>
								</view>
								<VIDEO v-show="item.local_camera==0" class="videocls height350"
									:id="'afarend_video'+ (index+1)"></VIDEO>

								<view class="posiab bottom0 height72 width1000 flex-a-i bg1a1a1a pl20">
									<image mode="widthFix" v-if="item.local_audio" class="image width50"
										src="/static/img/jiechujingyin.png"></image>
									<image mode="widthFix" v-else class="image width50" src="/static/img/huimaio.png">
									</image>
									{{item.protocol=="rtsp"?'':item.role=="chair"?'主持人:':'参会人:'}}
									{{item.display_name}}
								</view>

							</view>
							<!-- <template v-else>
							<view v-if="video_list.length" class="colorfff bg000 mt30 width700 posire ">
								<view v-if="video_list[0].local_camera" class="videocls height350 flex-ju-c">
									<image class="width120 height120" src="/static/img/xaing.png"></image>
								</view>
								<VIDEO class="videocls height350" v-show="video_list[0].local_camera==0" id="fous_arend_video"></VIDEO>
								<view class="posiab bottom0 height72 width1000 flex-a-i bg1a1a1a pl20">
									<image mode="widthFix" v-if="video_list[0].is_muted" class="image width50"
										src="/static/img/jiechujingyin.png"></image>
									<image mode="widthFix" v-else class="image width50" src="/static/img/huimaio.png">
									</image>
									{{video_list[0].protocol=="rtsp"?'':video_list[0].role=="chair"?'主持人:':'参会人:'}}
									{{video_list[0].display_name}}
								</view>
							</view>
							</template> -->

							<view class="colorfff bg000 mt30 width700 posire ">
								<view v-if="tahtinfo.local_camera" class="videocls height350 flex-ju-c">
									<view class="posire">
										<image mode="widthFix" class="image mb20 wh120-120" src="/static/img/xaing.png">
										</image>
										<image mode="widthFix" v-if="tahtinfo.role=='chair'"
											class="image wh40-40 posiab bottom10 right0"
											src="/static/img/chaungjian.png">
										</image>
									</view>
								</view>
								<VIDEO v-show="tahtinfo.local_camera==0" style="height:350rpx;" class="hauto width1000"
									id="local_video_all">
								</VIDEO>
								<view class="posiab bottom0 height72 width1000 flex-a-i bg1a1a1a pl20">
									<image mode="widthFix" v-if="tahtinfo.is_muted" class="image width50"
										src="/static/img/jiechujingyin.png"></image>
									<image mode="widthFix" v-else class="image width50" src="/static/img/huimaio.png">
									</image>
									{{tahtinfo.protocol=="rtsp"?'':tahtinfo.role=="chair"?'主持人:':'参会人:'}}
									{{tahtinfo.display_name}}
								</view>
							</view>

						</view>
					</view>
				</scroll-view>

			</view>

			<view class="size32 posire flex-a-i zindex2 colorfff ml50 ">
				<view @click.stop="showinfo" class="flex-a-i">
					{{meetingInfo.name}}({{meetingInfo.mr_id}}）<image mode="widthFix" class="image width50 mr50"
						src="/static/img/dowm.png"></image>
				</view>
				{{textContent}}
				<view v-if="isinfo" style="box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.10);"
					class="posiab bgfff wh670-400 top80 ra15 color333">
					<view class="pg25">
						<view class="flex-a-i">
							<image mode="widthFix" class="image width100 mr20" src="/static/img/xaing.png"></image>
							{{meetingInfo.name}} ({{meetingInfo.mr_id}}）
						</view>
						<view class="border-te6ebf0 mt20">
							<view class="flex-a-i mt20">会议号码：{{meetingInfo.mr_id}}
								<image @click="copy(meetingInfo.mr_id+'')" mode="widthFix" class="image width36 ml20"
									src="/static/img/copy.png"></image>
							</view>
							<view class="flex-a-i mt20 mb20">参会密码：{{meetingInfo.join_pwd}}</view>
							<view class="flex-a-i">开始时间：{{thistime}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="flex-a-i  mb10">
				<view v-if="ishuahua" class="posiab bg1e1e1e pg20-20 ra15 zindex150 width350 top120">
					<view @click="yanjiang" class="flex-a-i colorfff">
						<image mode="widthFix" class="image width50" src="/static/img/yanzhen.png"></image>
						<view class="ml30 mr20">演讲者模式</view>
						<image v-if="yindex==0" mode="widthFix" class="image width36 ml30" src="/static/img/gougou.png">
						</image>
					</view>
					<view @click.stop="hualang" class="flex-a-i colorfff mt20">
						<image mode="widthFix" class="image width50" src="/static/img/hualan.png"></image>
						<view class="ml30 mr20">画廊模式</view>
						<image v-if="yindex==1" mode="widthFix" class="image width36 ml30" src="/static/img/gougou.png">
						</image>
					</view>
				</view>

				<view @click="taphua" class="bg1e1e1e flex-a-i colorfff size 28 pg20-20 ra15 width350">
					<image mode="widthFix" class="image width50" v-if="yindex==1" src="/static/img/hualan.png"></image>
					<image mode="widthFix" class="image width50" v-else src="/static/img/yanzhen.png"></image>

					<view class="ml30 mr20">{{yindex==1?'画廊模式':'演讲者模式'}}</view>

					<image mode="widthFix" class="image width50" src="/static/img/xiala.png"></image>

				</view>
				<image @click="tapquanping(1)" v-if="isquan==0" mode="heightFix" class="image height75 ml90 mr50"
					src="/static/quanbing.png"></image>
				<image @click="tapquanping(0)" v-else mode="heightFix" class="image height75 ml90 mr50" src="/static/noping.jpg"></image>
				<template v-if="isquan==0">
					<view @click="onMin" class="hovers flex-ju-c wh60-60 mr40">
						<image mode="widthFix" class="image width50 " src="/static/img/bheng.png"></image>
					</view>
					<view @click="onMax" class="hovers flex-ju-c wh60-60 mr40">

						<image v-if="windowMax" mode="widthFix" class="image width50  " src="/static/min.png">
						</image>
						<image v-else mode="widthFix" class="image width50  " src="/static/metting/da.png"></image>
					</view>
					<view @click="onClose" class="hover flex-ju-c wh60-60 mr10">
						<image mode="widthFix" class="image width50" src="/static/img/bbi.png"></image>
					</view>
				</template>



			</view>
		</view>


		<CANVAS id="image_canvas" :style="{height:hhg+'px'}"
			style="border: 1px solid #000;width:90%;opacity: 0;position:absolute;top:-9999px;"></CANVAS>
		<view v-if="shareMP" :style="{width:Width+'px'}" class="height50px zindex110 posifi top121">
			<view class="flex-ju-c posire  zindex20">
				<view class="posiab top0 zindex11 wh700-95 colorfff flex-ju-a size28 bg1e1e1e"
					style="box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.10);">
					<view v-if="shareevent.uuid == my_pp_uuid" class="flex-a-i ">
						<image mode="widthFix" class="image width40 mr15" src="/static/img/bgongx.png"></image>
						您正在共享{{gx==1?'白板':gx==2?'图片':gx==3?'PDF':'屏幕'}}
					</view>
					<view v-else class="flex-a-i ">
						{{shareevent.display_name}}
						正在共享
					</view>

					<view @click="ismokaui=!ismokaui" v-if="changed_key"
						class="flex-ju-c wh100-56 colorfff ra5 bg165FFF">批注</view>
					<view v-if="shareevent.uuid == my_pp_uuid" @click="endShare"
						class="flex-ju-c wh160-56 colorfff ra5 bgF05862">结束共享</view>
				</view>

				<view v-if="ismokaui" class="posiab top110 zindex11 wh750-100 color333 flex-ju-a bgfff size24 ra10"
					style="box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.10);">
					<view @click="tapgong(k)" v-for="(item,k) in gxdata" :key="k" :class="k==kindex?'active':''"
						class="flex-ju-c posire flex-col hoverpi">
						<image mode="widthFix" class="image width40 " :src="item.img"></image>
						{{item.txt}}
					</view>
					<view v-if="isqingchu" @mouseleave="isqingchu=false"
						style="box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.10);"
						class="posiab width270 bgfff top130 ml400">
						<view class="up" style="margin-left:30px;"></view>
						<view v-if="shareevent.uuid == my_pp_uuid" @click="tapisqingchu(0)"
							class="height80 flex-a-i hoverpi pl20">
							清除所有人的批注
						</view>
						<view @click="tapisqingchu(1)"
							class="height80 flex-a-i pl20 hoverpi border-tE5E6EB border-bE5E6EB">清除我的批注</view>
						<view v-if="shareevent.uuid == my_pp_uuid" @click="tapisqingchu(2)"
							class="height80 hoverpi flex-a-i pl20">
							清除其他人的批注
						</view>
					</view>
				</view>
				<view @mouseleave="colodemouseleave" v-if="iscolore"
					class="posiab top230 zindex11 wh650-220 bgfff  ra10"
					style="box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.10);">
					<view class="up"></view>
					<view class="flex-a-i mt30">
						<view class=" flex-ju-c width20px ml50" @click="tapxian(item,h)" v-for="(item,h) in xiandata"
							:key="h">
							<view :style="{width: item+'px',background:h==hindex?'#165FFF':''}" class="bixi"></view>
						</view>
					</view>

					<view class="border-tE5E6EB mt30">
						<view class="flex-a-i mt30">
							<view class="pg10 ml30 ra6" :class="pindex == p ?'pcolode':''" @click="tapcolode(item,p)"
								v-for="(item,p) in colodedata" :key="p">
								<view :style="{background: item}" class="ccolod wh32-32 ra6 bgred "></view>
							</view>
						</view>
					</view>
				</view>


			</view>
		</view>
		<view v-if="shareMP" class="posiab  bg000 zindex1  colorfff " id="whiteboard"
			:style="{height:hhg+'px',width:Width+'px'}">

			<view v-show="shareevent.uuid != my_pp_uuid" style="position: absolute;">
				<VIDEO id="huixian" class="width1000" :style="{height:hhg+'px'}"></VIDEO>
			</view>

			<view v-if="gx==2||gx==3" class="flex-ju-c    posiab bottom40 width1000">
				<view v-if="numpage>1" style="background: rgba(0, 0, 0, .6);"
					class="zindex150 wh240-90 ra90 colorfff flex-ju-a size28">
					<image @click="imgPrivious" mode="widthFix" class="width30" src="/static/img/baoorw.png"></image>
					<template v-if="gx==3">
						{{thatimg}}/{{numpage}}
					</template>
					<image @click="imgNext" mode="widthFix" class="width30 xuanz" src="/static/img/baoorw.png"></image>
				</view>

				<view v-if="imglistfile.length>1" style="background: rgba(0, 0, 0, .6);"
					class="zindex150 wh240-90 ra90 colorfff flex-ju-a size28">
					<image @click="imgPrivious" mode="widthFix" class="width30" src="/static/img/baoorw.png"></image>
					<template v-if="gx==2">
						{{thatimg}}/{{imglistfile.length}}
					</template>
					<image @click="imgNext" mode="widthFix" class="width30 xuanz" src="/static/img/baoorw.png"></image>
				</view>

			</view>
		</view>


		<view class="flex " id="w_view">

			<view :style="{height:hhg+'px'}" class="flex1 bg000 flex-ju-c colorfff ">
				
				<template v-if="isquanvideo">
					<view @click="onExpand"  @mousedown.stop="onDown" @mouseup.stop="onUp" class="posiab zindex160 right10 top35vh">
						<view :style="{transform:'translate('+offsetX+'px,'+offsetY+'px)'}" 
							class="bg2c2c2c flex-ju-c ml-50 flex-col colorfff size20 pg10 ra15 draggable">
							<image mode="widthFix" class="image width40 mb5" src="/static/img/noquan.png"></image>
							<view>展开</view>
						</view>
					</view>
				</template>
				
				
				<!-- <view v-if="isquanvideo" class="posiab zindex160 right10 top35vh">
					<view @click="isquanvideo=false,iscide=true"
						class="bg2c2c2c flex-ju-c ml-50 flex-col colorfff size20 pg10 ra15">
						<image mode="widthFix" class="image width40 mb5" src="/static/img/noquan.png"></image>
						<view>展开</view>
					</view>
				</view> -->


				<view v-show="yindex==0||mlist.length==1" @mousedown="onVideoTab(0)"  @mousemove.stop="onMove"  id="local_width"
					class=" width1000 hauto">
						
					<!-- <VIDEO v-show="isVideo" class="hauto width1000" id="local_video1">
					</VIDEO> -->
					<view v-show="isVideo" class="hauto">
						<view v-if="local_video_view.local_camera==1" class="hauto width1000 flex-ju-c  flex-col">
							<view class="posire" style="z-index:auto;">
								<image mode="widthFix" class="image mb20 wh280-280 mr30" src="/static/img/xaing.png">
								</image>
								<image v-if="local_video_view.role=='chair'" mode="widthFix"
									class="image wh70-70 zindex0 posiab bottom40 right30" src="/static/img/chaungjian.png">
								</image>
							</view>
							<view>{{local_video_view.display_name}} {{local_video_view.role=='chair'?'，主持人':''}}</view>
						</view>
						<VIDEO v-show="local_video_view.local_camera==0" class="hauto width1000" id="local_video1">
						</VIDEO>
					</view>
					
					
					<view v-if="tahtinfo.local_camera&&!isVideo" class="hauto width1000 flex-ju-c  flex-col">
						<view class="posire" style="z-index:auto;">
							<image mode="widthFix" class="image mb20 wh280-280 mr30" src="/static/img/xaing.png">
							</image>
							<image v-if="tahtinfo.role=='chair'" mode="widthFix"
								class="image wh70-70 zindex0 posiab bottom40 right30" src="/static/img/chaungjian.png">
							</image>
						</view>
						<view>{{tahtinfo.display_name}} (我{{tahtinfo.role=='chair'?'，主持人':''}}）</view>
					</view>
					<VIDEO v-show="tahtinfo.local_camera==0" class="hauto width1000" id="local_video">
					</VIDEO>

				</view>



				<view v-show="yindex==1&&mlist.length>1" id="localWidth"
					class="width1000 hauto scroll-view flex-wrap flex-a-i">
					<!-- <view class="width1000 hauto  flex-wrap flex ">

						<view v-show="mlist.length==2" class="flex-ju-c flex1 " style="width:100%;">
							<VIDEO id="screen2-0" style="width:50%;" class="flex1  ">
							</VIDEO>
							<VIDEO id="screen2-1" style="width:50%;" class="flex1  ">
							</VIDEO>
						</view>

						<view v-show="mlist.length==3" class="flex-ju-c flex1 flex-col">
							<VIDEO id="screen3-0" class=" " style="width:50%;">
							</VIDEO>
							<view class="flex-a-i width1000">
								<VIDEO id="screen3-1" style="width:50%;" class=" ">
								</VIDEO>
								<VIDEO id="screen3-2" style="width:50%;" class=" ">
								</VIDEO>
							</view>
						</view>

						<view v-show="mlist.length==4" class="flex-ju-c flex1 flex-col">
							<view class="width1000 flex">
								<VIDEO id="screen4-0" style="width:50%;" class="  ">
								</VIDEO>
								<VIDEO id="screen4-1" style="width:50%;" class="  ">
								</VIDEO>
							</view>
							<view class="width1000 width1000 flex">
								<VIDEO id="screen4-2" style="width:50%;" class=" ">
								</VIDEO>
								<VIDEO id="screen4-3" style="width:50%;" class=" ">
								</VIDEO>
							</view>
						</view>

						<view v-show="mlist.length==5" class="flex-ju-c flex1 flex-col">
							<view class="width1000 flex">
								<VIDEO id="screen5-0" style="width:50%;" class="  ">
								</VIDEO>
								<VIDEO id="screen5-1" style="width:50%;" class="  ">
								</VIDEO>
							</view>
							<view class="width1000 width1000 flex">
								<VIDEO id="screen5-2" style="width:33.3%;" class=" ">
								</VIDEO>
								<VIDEO id="screen5-3" style="width:33.3%;" class=" ">
								</VIDEO>
								<VIDEO id="screen5-4" style="width:33.3%;" class=" ">
								</VIDEO>
							</view>
						</view>

						<view v-show="mlist.length==6" class="flex-ju-c flex1 flex-col">
							<view class="width1000 flex">
								<VIDEO id="screen6-0" style="width:33.3%;">
								</VIDEO>
								<VIDEO id="screen6-1" style="width:33.3%;">
								</VIDEO>
								<VIDEO id="screen6-2" style="width:33.3%;">
								</VIDEO>
							</view>
							<view class="width1000 width1000 flex">
								<VIDEO id="screen6-3" style="width:33.3%;">
								</VIDEO>
								<VIDEO id="screen6-4" style="width:33.3%;">
								</VIDEO>
								<VIDEO id="screen6-5" style="width:33.3%;">
								</VIDEO>
							</view>
						</view>
						
						<view v-show="mlist.length==7" class="flex-ju-c flex1 flex-col">
							<view class="width1000 flex">
								<VIDEO id="screen7-0" style="width:50%;">
								</VIDEO>
								<VIDEO id="screen7-1" style="width:50%;">
								</VIDEO>
							</view>
							<view class="width1000  flex">
								<VIDEO v-for="item in [2,3,4,5,6]" :key="item" :id="'screen7-'+item" style="width:20%;">
								</VIDEO>
							</view>
						</view>

						<view v-show="mlist.length==8" class="flex-ju-c flex1 flex-col">
							<view class="width1000 flex">
								<VIDEO id="screen8-0" style="width:50%;">
								</VIDEO>
								<VIDEO id="screen8-1" style="width:50%;">
								</VIDEO>
							</view>
							<view class="width1000  flex">
								<VIDEO style="width:16.6%;" v-for="item in [2,3,4,5,6,7]" :key="item" :id="'screen8-'+item">
								</VIDEO>
							</view>
						</view>
						<swiper v-show="mlist.length > 8" class="flex1 hauto">
							<swiper-item v-for="(item,g) in totalPages" :key="item" class="">
								<view class="flex flex1 flex-wrap hauto">
										<VIDEO v-for="(items,f) in item" :key="f" :id="'screen9-'+items" style="width:33%;">
										</VIDEO>
								</view>
							</swiper-item>
						</swiper>
					</view> -->
					<split-screen :my_pp_uuid="my_pp_uuid" :totalPages="totalPages" :tahtinfo="tahtinfo" :hhg="hhg-5"
						:width="w_view-5" :video_list="video_list" :mlist="mlist"></split-screen>
				</view>

			</view>

			<view v-if="isquan==0">

				<!-- 	<view v-if="!iscanhui&yindex==0" class="posiab top47vh"> -->
				<view v-if="yindex==0" class="posiab top47vh">
					<view @click="donghuamin" class="zhongjiang flex-ju-c ml-50">
						<image v-if="dongwidth==0" mode="widthFix" class="image width50" src="/static/img/dongleft.png">
						</image>
						<image v-else mode="widthFix" class="image width50" src="/static/img/dongright.png"></image>
					</view>
				</view>
			</view>

			<view class="scroll-view posire hidden" :style="{height:hhg+'px',width:dongwidth}">


				<view v-show="iscanhui">
					<view class="colorfff flex-ju-a width700">
						<view @click="canshu(0)"
							:style="{background: cindex==0?'#1e1e1e':'',color:cindex==0?'#fff':'#9F9F9F'}"
							class=" flex-ju-c flex1 height80">参会者</view>
						<view @click="canshu(1)"
							:style="{background: cindex==1?'#1e1e1e':'',color:cindex==1?'#fff':'#9F9F9F'}"
							class="flex-ju-c flex1 height80">聊天</view>
					</view>

					<view v-show="cindex==0">
						<view class="pg30 ">
							<view class="flex-a-i bg1e1e1e pg20-30 posire ra10">
								<input class="flex1 colorfff" v-model="cname" @confirm="saosao" placeholder="请输入参会者名称">
								<image mode="widthFix" @click="cname='',saosao()" v-if="cname"
									class="image posiab width35 right110" src="/static/img/jiankong/34.png">
								</image>

								<image mode="widthFix" @click="saosao" class="image posiab width32 right20"
									src="/static/img/bsuo.png">
								</image>
							</view>
						</view>
						<view class="color909f90 flex-a-i border-b5C5C5C mb30">
							<view @click="tapkin(0)" :style="{color:aindex==0?'#fff':''}"
								class="flex-ju-c flex-col ml50">
								全部({{mlist.length}})
								<view :style="{background: aindex==0?'#fff':''}" class="wh50-5  mt5"></view>
							</view>

							<view @click="tapkin(1)" :style="{color:aindex==1?'#fff':''}"
								class="flex-ju-c flex-col ml80">
								静音({{yinbumber}})
								<view :style="{background: aindex==1?'#fff':''}" class="wh50-5  mt5"></view>
							</view>
						</view>

						<scroll-view scroll-y :style="{height:hhg-250+'px'}" class=" ">

							<view v-if="iyin" :style="{marginTop:(120*(isjing+1))+'rpx'}"
								class="posiab  bg1e1e1e right0 colorfff zindex5">
								<view class="width330 ra10 bg1e1e1e">
									<view v-if="ischair||dianitem.uuid==my_pp_uuid"
										@click="tapdanjingyin(dianitem),iyin=false" class="height70 flex-ju-c jingyin">
										{{dianitem.local_audio ? '取消静音':'静音'}}
									</view>
									<view @click="gaiming(),iyin=false" class="height70 flex-ju-c jingyin">改名</view>

									<view v-if="ischair&&dianitem.protocol!='rtsp'"
										@click="sheweizhuchi(dianitem),iyin=false" class="height70 flex-ju-c jingyin ">
										<template></template>
										{{dianitem.role=='chair'?'取消主持人':'设为主持人'}}
									</view>
									<view @click="$refs.huiyi.show(),iyin=false" v-if="ischair"
										class="height70 flex-ju-c jingyin">移除
									</view>
								</view>
							</view>

							<view @click="canhui(item,d)" v-for="(item,d) in clist" :key="d"
								:style="{background:d==mindex?'#1e1e1e':'','border-left':d==mindex?'5px solid #165FFF':''}"
								class="flex-ju-b colorfff sphoner height120 ">

								<view class="flex-a-i pl30  posire">
									<image v-if="item.protocol =='rtsp'" mode="widthFix" class="image width80 mr30"
										src="/static/img/came.png">
									</image>
									<image v-else-if="item.protocol =='zjcs'" mode="widthFix" class="image width80 mr30"
										src="/static/img/zjcs.png">
									</image>
									<image v-else-if="item.protocol =='sip'||item.protocol =='h323'" mode="widthFix"
										class="image width80 mr30" src="/static/img/zjcs.png">
									</image>
									<image v-else mode="widthFix" class="image width80 mr30"
										src="/static/img/xaing.png">
									</image>

									<image mode="widthFix" v-if="item.role=='chair'" style="position: absolute;"
										class="image width30 left80 bottom0" src="/static/img/chaungjian.png">
									</image>
									<view>
										<view class="size32">{{item.display_name}}</view>
										<view class="size24 color9F9F9F">
											{{item.role=="chair"?'主持人':''}}{{item.uuid==my_pp_uuid?'(我)':''}}
											<text v-if="item.is_presenting" class="color165FFF ml30">演示中...</text>
										</view>
									</view>
								</view>
								<view class="flex-a-i ">


									<template v-if="item.local_audio">
										<image mode="widthFix" class="image width50"
											src="/static/img/jiechujingyin.png"></image>
									</template>
									<template v-else>
										<image mode="widthFix" class="image width50" src="/static/img/huimaio.png">
										</image>
									</template>


									<template v-if="item.local_camera">
										<image mode="widthFix" class="image width50 ml30 mr30"
											src="/static/img/kaiqishipng.png"></image>
									</template>
									<template v-else>
										<image mode="widthFix" class="image width50 ml30 mr30"
											src="/static/img/openvideos.png"></image>
									</template>


									<image v-if="ischair||item.uuid==my_pp_uuid" @click="tapbdian(item,d)"
										mode="widthFix" class="image width50" src="/static/img/bsandian.png"></image>

								</view>
							</view>
							<view v-if="!clist.length" class="flex-ju-c flex-col colorfff size24 mt150">
								<image mode="widthFix" class="width300 mb15" src="/static/img/jiankong/42.png"></image>
								暂未查询到内容
							</view>
						</scroll-view>

						<view v-if="ischair"
							class="colorfff size28 flex-ju-a border-t5C5C5C pt20 posiab width700 bottom0 pb30"
							style="border-bottom:1px solid #121212;">
							<view @click="tapjingyin" class="flex-ju-c ra15 wh250-72  bg1E1E1E posire">
								<view v-if="isyin" class="posiab width250 bottom80 border5C5C5C ra10 bg1e1e1e">
									<view @click.stop="yesyin" class="height72 jingyin flex-ju-c">全体静音</view>
									<view @click.stop="noyin" class="height72 jingyin flex-ju-c">全体不静音</view>
								</view>
								<view class="">
									{{yin}}
								</view>
								<image mode="widthFix" v-if="isyin" class="image width50" src="/static/img/jtop.png">
								</image>
								<image mode="widthFix" v-else class="image width50" src="/static/img/bxia.png"></image>
							</view>

							<view @click="tapYaoqing" v-if="type!=1" class="flex-ju-c ra15 wh250-72  bg585858">通讯录邀请
							</view>
						</view>
						<view v-else class="flex-ju-c hidden">
							<view @click="$refs.zhuchimima.open()" :style="{width:dongwidth=='0'?'0':'500rpx'}"
								class="flex-ju-c colorfff hidden bg585858 wh500-70 ra10 posifi bottom150">
								主持会议
							</view>
						</view>
					</view>

					<view v-show="cindex==1" class=" colorfff size28">

						<scroll-view scroll-y :style="{height:hhg-200+'px'}">

							<template v-for="(item,f) in allinfo" :key="f">

								<view v-if="comparedItems[f]" class="flex-ju-c colorfff  mt20">
									{{comparedItems[f]}}
								</view>

								<view v-if="item.name" class="flex mt20 ml20">
									<image mode="widthFix" class="image width80" src="/static/img/xaing.png"></image>
									<view class="ml20">
										<view class="">{{item.name}}</view>
										<view class="bgfff pg20 maxw color333 xinxias mt15">{{item.msg}}</view>
									</view>
								</view>

								<view v-else class="flex-row mt20 mr20">
									<view class="flex">
										<view class="bg165FFF pg20 maxw xinxia mt15 mr20">{{item.msg}}</view>
										<image mode="widthFix" class="image width80" src="/static/img/xaing.png">
										</image>
									</view>
								</view>

							</template>


						</scroll-view>

						<view class="posiab bottom0 bg383838 width1000 colorfff  size28">
							<view class="pg25">
								<view class="mb10">发送至 所有人</view>
								<textarea v-model="textinfo" @focus="textFocus" class="flex1 height120"></textarea>
								<view class="flex-row">
									<el-button @click="butfasong" :disabled="!textinfo" type="primary">发送</el-button>
								</view>
							</view>
						</view>
					</view>

				</view>
				<view class="aliiton hidden">

					<scroll-view scroll-y v-show="!iscanhui&&yindex!=1" :style="{height:hhg+'px'}" class="">

						<view class="pg20">
							<view v-if="video_list.length" v-for="(item,index) in video_list"
								@mousedown="onVideoTab(item)" :key="index" class="colorfff bg000 mt30 width700 posire ">
								<view v-if="item.local_camera" class="videocls height350 flex-ju-c">
									<view class="posire">
										<image mode="widthFix" class="image mb20 wh120-120" src="/static/img/xaing.png">
										</image>
										<image mode="widthFix" v-if="item.role=='chair'"
											class="image wh40-40 posiab bottom10 right0"
											src="/static/img/chaungjian.png">
										</image>
									</view>
								</view>

								<VIDEO v-show="item.local_camera==0" class="videocls height350"
									:id="'farend_video'+ (index+1)"></VIDEO>

								<view class="posiab bottom0 height72 width1000 flex-a-i bg1a1a1a pl20">
									<image mode="widthFix" v-if="item.local_audio" class="image width50"
										src="/static/img/jiechujingyin.png"></image>
									<image mode="widthFix" v-else class="image width50" src="/static/img/huimaio.png">
									</image>
									{{item.protocol=="rtsp"?'':item.role=="chair"?'主持人:':'参会人:'}}
									{{item.display_name}}

								</view>
							</view>
							<VIDEO v-else class="videocls height350" id="fous_arend_video"></VIDEO>
						</view>

					</scroll-view>
				</view>
			</view>
		</view>

		<view class="flex-ju-b colorfff size24 height135">
			<view class="flex-a-i posire">
				<view v-if="isyangshen" class="posiab bottom150 ra15 pg10-30 width500 bg1e1e1e ml40">

					<view class="flex-a-i ">
						<image @click="minyin" mode="widthFix" class="image width32" src="/static/img/jinyin.png">
						</image>
						<view class="flex-ju-c flex1">
							<el-slider @input="inputslider" style="width:85%;" v-model="slideryin" />
						</view>
						<image @click="maxyin" mode="widthFix" class="image width32" src="/static/img/shenyin.png">
						</image>
					</view>

				</view>
				<view @click="tapSound" class="flex-ju-c flex-col ml80">
					<image v-if="issound" mode="widthFix" class="image width50" src="/static/img/yangshengqu.png">
					</image>
					<image v-else mode="widthFix" class="image width50" src="/static/img/jinyin.png"></image>
					扬声器
				</view>
				<view @click.stop="tapshowyang" :class="isyangshen?'chatActive':''" class="height135  flex-ju-c">
					<image mode="widthFix" :class="isyangshen?'rotate':''" class="image width50"
						src="/static/img/xiala.png"></image>
				</view>
			</view>


			<view class="flex-a-i">
				<view class="flex-a-i posire">

					<view v-if="ismsmic" class="posiab bottom150 ra15 pg10-50  bg1e1e1e ">
						<view class="">
							<view @click="switch_mic(item,t)" v-for="(item,t) in audioinput" :key="t"
								class="flex-a-i height70" style="white-space: nowrap;">{{item.label}} {{item.kind}}
								<image mode="widthFix" v-if="item.is_default" class="image width30 ml50"
									src="/static/img/gougou.png"></image>
							</view>

							<view @click="ismsmic=false" v-if="!audioinput.length" class="flex-a-i height70"
								style="white-space: nowrap;">未检测到麦克风设备
							</view>
						</view>
					</view>


					<view @click="jiechuyin" class="flex-ju-c flex-col ml80">

						<image mode="widthFix" class="image width50" v-if="ismic" src="/static/img/jiechujingyin.png">
						</image>
						<image mode="widthFix" class="image width50" v-else src="/static/img/huimaio.png">
						</image>
						{{tahtinfo.local_audio==1?'关闭静音':'开启静音'}}

					</view>
					<view @click.stop="ismsmic = !ismsmic" :class="ismsmic?'chatActive':''"
						class="height135  flex-ju-c">
						<image :class="ismsmic?'rotate1':''" mode="widthFix" class="image width50"
							src="/static/img/xiala.png"></image>
					</view>

				</view>
				<view class="flex-a-i">
					<view class="flex-ju-c flex-col ml80">

						<view v-if="isCamera" class="posiab bottom150 ra15 pg10-50  bg1e1e1e ml150">
							<view class="">
								<view @click="switch_cam(item)" v-for="(item,t) in videoLsit" :key="t"
									class="flex-a-i height70" style="white-space: nowrap;">{{item.label}} {{item.kind}}
									<image mode="widthFix" v-if="item.is_default" class="image width30 ml50"
										src="/static/img/gougou.png"></image>
								</view>
								<view @click="isCamera=false" v-if="!videoLsit.length" class="flex-a-i height70"
									style="white-space: nowrap;">未检测到摄像头
								</view>
							</view>
						</view>


						<view @click="openvideo" class="flex-ju-c flex-col">
							<image mode="widthFix" class="image width50" v-if="iscam" src="/static/img/kaiqishipng.png">
							</image>
							<image mode="widthFix" class="image width50" v-else src="/static/img/openvideos.png">
							</image>
							{{tahtinfo.local_camera==1?'关闭视频':'开启视频'}}
						</view>


						<!-- <template v-if="videoLsit.length">
							<image mode="widthFix" class="image width50" v-if="iscam" src="/static/img/kaiqishipng.png">
							</image>
							<image mode="widthFix" class="image width50" v-else src="/static/img/openvideos.png">
							</image>
							{{iscam?'关闭视频':'开启视频'}}
						</template>
						
						<template v-else>
							<image mode="widthFix" class="image width50" src="/static/img/kaiqishipng.png"></image>
							开启视频
						</template> -->

					</view>
					<view @click.stop="isCamera = !isCamera" :class="isCamera?'chatActive':''"
						class="height135  flex-ju-c">
						<image mode="widthFix" :class="isCamera?'rotate2':''" class="image width50"
							src="/static/img/xiala.png"></image>
					</view>

				</view>

				<view v-if="isShare" @click="endShare" class="flex-ju-c flex-col ml80 ">
					<image mode="widthFix" class="image width50" src="/static/img/endshrre.png"></image>
					结束共享
				</view>

				<view v-else @click="textShare" class="flex-ju-c flex-col ml80 ">
					<image mode="widthFix" class="image width50" src="/static/img/gongxiang.png"></image>
					内容共享
				</view>

				<view @click="tapcan" :class="bgParticipation?'participationActive':''"
					class="flex-ju-c flex-col ml60  width135 height135">
					<image mode="widthFix" class="image width50" src="/static/img/canhuizhe.png"></image>
					参会者({{mlist.length}})
				</view>
				<view @click="allchat" :class="bgChat?'chatActive':''"
					class="flex-ju-c flex-col ml20 posire   width135  height135">
					
					<image mode="widthFix" class="image width50" src="/static/img/liantian.png"></image>
					聊天
					<view v-if="allnumberchat>0" class="posiab chaindo flex-ju-c top12 right25 bgFC474C">{{allnumberchat}}
					</view>
				</view>
			</view>

			<view v-if="ischair" class="bgF05862    mr80 posire">
				<view v-if="showclode" @mouseleave="handleMouseLeave" class="posiab bgfff ra15 bottom90 pg20 ">
					<view @click="$refs.showlikai.show()" class="borderBFBFBF color333 wh200-70 flex-ju-c mb10">离开会议
					</view>
					<view @click="$refs.showjieshu.show()"
						class="borderF05862 bgF05862 colorfff wh200-70 flex-ju-c mt20">结束会议</view>
				</view>
				<view @mouseenter="handleMouseEnter" class="wh200-72 flex-ju-c ra10">结束会议</view>
			</view>
			<view v-else class=" bgfff mr80 posire">
				<view @click="$refs.showlikai.show()" class="bgF05862 borderF05862 colorfff wh200-70 flex-ju-c ">离开会议
				</view>
			</view>
		</view>



		<uni-popup @change="upchange" ref="goxnag" mode="center">
			<view class="bgfff ra30  posire pt50 ">
				<image @click="$refs.goxnag.close()" mode="widthFix" class="image posiab right30 top20 width50"
					src="/static/img/bi.png"></image>
				<view class="size36 color333 bold flex-a-i ml50 ">
					<view class="wh6-30 mt8 bg2C7BFF mr15"></view>选择共享内容
				</view>

				<view class="pg50 text-left">
					<view>桌面</view>
					<image @click="gx=0,pdffiles='',imglist=[]" :style="{border:gx==0?'2px solid #165FFF':''}"
						class="image wh360-200 mt15 ra20" src="/static/mian.png"></image>
					<view class="center width360 mt15">整个屏幕</view>
				</view>
				<view class="pg50 text-left">
					<view class="mb15">文件</view>

					<view class="flex-ju-a">
						<view @click="gx=1,pdffiles='',imglist=[]">
							<view :style="{border:gx==1?'2px solid #165FFF':''}"
								class="wh360-200 flex-ju-c ra20 borderDBDBDB">
								<image mode="widthFix" class="image width64" src="/static/img/baiban.png"></image>
							</view>
							<view class="center width360 mt15">白板</view>
						</view>

						<view @click="setimg(2)" class="ml50 mr50">
							<view :style="{border:gx==2?'2px solid #165FFF':''}"
								class="wh360-200 flex-ju-c ra20 borderDBDBDB">
								<image mode="widthFix" class="image width64" src="/static/img/tupian.png"></image>
							</view>
							<view class="center width360 mt15">图片</view>
						</view>

						<view @click="gxpdf(3)">
							<view :style="{border:gx==3?'2px solid #165FFF':''}"
								class="wh360-200 flex-ju-c ra20 borderDBDBDB">
								<image mode="widthFix" class="image width64" src="/static/img/pdf.png"></image>
							</view>
							<view class="center width360 mt15">PDF</view>
						</view>
					</view>
					<view class="flex-a-i color165FFF">
						<image v-for="(item,f) in imglist" v-if="imglist.length" :key="f" class="image wh100-100 mr20"
							:src="item"></image>
						<view v-if="pdffiles">{{pdffiles.name}}</view>
					</view>
				</view>


				<view class="flex-row border-te6ebf0 mt10">
					<view class="flex-a-i pg50">
						<view @click="$refs.goxnag.close()" class="wh152-64 borderd0d6dc flex-ju-c ra5">取消</view>
						<view @click="stoerxiang" class="wh192-64 border165DFF colorfff bg165dff flex-ju-c ml60 ra5">
							开始共享</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<uni-popup ref="setname" :mode="mode">
			<view class="bgfff ra30 width880 posire pt50 pb50">
				<image @click="$refs.setname.close()" mode="widthFix" class="image posiab right30 top20 width50"
					src="/static/img/bi.png"></image>
				<view class="size36 color333 bold flex-a-i ml50 mb60">
					<view class="wh6-30 mt8 bg2C7BFF mr15"></view>参会名称
				</view>
				<view class="pg0-50">
					<el-input v-model="turname" placeholder="输入名称"></el-input>
				</view>
				<view class="flex-ju-c">
					<view class="flex-a-i mt80">
						<view @click="$refs.setname.close()" class="wh152-64 borderd0d6dc flex-ju-c ra5">取消</view>
						<view @click="quename" class="wh152-64 border165DFF colorfff bg165dff flex-ju-c ml60 ra5">确定
						</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<!-- <chair-pwd ref="upChairPWD"></chair-pwd> -->

		<uni-popup ref="zhuchimima" :mode="mode">
			<view class="bgfff ra30 width880 posire pt50 pb50">
				<image @click="$refs.zhuchimima.close()" mode="widthFix" class="image posiab right30 top20 width50"
					src="/static/img/bi.png"></image>
				<view class="size36 color333 bold flex-a-i ml50 mb60">
					<view class="wh6-30 mt8 bg2C7BFF mr15"></view>请输入主持密码
				</view>
				<view class="pg0-50">
					<el-input v-model="mimahuiyis" placeholder="输入密码"></el-input>
				</view>
				<view class="flex-ju-c">
					<view class="flex-a-i mt80">
						<view @click="$refs.zhuchimima.close()" class="wh152-64 borderd0d6dc flex-ju-c ra5">取消</view>
						<view @click="gethuiyi" class="wh152-64 border165DFF colorfff bg165dff flex-ju-c ml60 ra5">确定
						</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<invite-communication :motting="motting" ref="upInvite"></invite-communication>

		<tishi @confirm="yuchu" isexit="1" ref="huiyi" :isclen="1" bgcolor="#165fff" title="您确定要移除吗？"></tishi>
		<tishi @confirm="likaimeeting" isexit="1" ref="likai" :isclen="0" bgcolor="#165fff" title="会议已结束"></tishi>


		<tishi @confirm="likaihui" isexit="1" ref="showlikai" isclen="1" bgcolor="#fc474c" title="您确定要离开会议吗？"></tishi>
		<tishi @confirm="jieshu" isexit="1" ref="showjieshu" isclen="1" bgcolor="#fc474c" title="结束会议将解散全体参会人，确定结束吗？">
		</tishi>

		<tishi ref="upLogOut" logout="1" bgcolor="#fc474c" title="当前账号在其他设备登录？"></tishi>

		<tishi @confirm="promptConfirm" @exitChange="exitChange" isexit="1" ref="upMute" :isclen="isclen"
			bgcolor="#165fff" :title="mute_title"></tishi>
	</view>
</template>

<script>
	window.setPropForVideo = function(elementId, stream) {
		console.log(stream, "dddd")
		const video = document.getElementById(elementId);
		if (video) {
			video.srcObject = stream;
			video.muted = true;
			video.autoplay = true;

			return true;
		}
		return false;
	}

	function base64ToBlob(base64data) {
		var arr = base64data.split(',');
		var mime = arr[0].match(/:(.*?);/)[1];
		var bstr = atob(arr[1]);
		var n = bstr.length;
		var u8arr = new Uint8Array(n);

		while (n--) {
			u8arr[n] = bstr.charCodeAt(n);
		}

		return new Blob([u8arr], {
			type: mime
		});
	}

	var timer_refresh_img = null;
	export default {
		data() {
			return {
				local_video_view:"",
				that_time: "",
				ischart: false,
				isclen: 0,
				isCamera: false,
				motting: [],
				bgParticipation: false,
				bgChat: false,
				isfirst: true,
				isVideo: false,
				videoShowUuid: [],
				videoShow: [],
				w_view: "",
				tahtinfo: "",
				changed_key: "", //是否共享屏幕
				pid: "",
				video_list: [],
				speaking: "",
				mute_title: "",
				voice: true,
				voice_video: false,
				voice_video_all: false,
				windowMax: false,
				Width: '100%',
				numpage: "",
				thatimg: 1,
				type: "",
				pdffiles: "",
				audioinput: [],
				mimahuiyis: "",
				iscide: false,
				isquanvideo: false,
				isquan: 0,
				allnumberchat: 0,
				ismsmic: false,
				listvideo: [],
				dongwidth: "auto",
				allinfo: [],
				textinfo: "",
				ischat: true,
				clist: [],
				cname: "",
				dianitem: {
					is_muted: null
				},
				user: uni.getStorageSync('user'),
				iscanhui: false,
				turname: "",
				mindex: -1,
				iyin: false,
				isjing: -1,
				yin: "全体不静音",
				isyin: false,
				aindex: 0,
				cindex: 0,
				gx: -1,
				imglist: [],
				imglistfile: [],
				pitemcolor: "#191919",
				xianitem: 1,
				isqingchu: false,
				isgong: false,
				ismokaui: false,
				iscolore: false,
				audiooutputValue: "",
				ischair: false,
				issound: true,
				shareevent: '',
				shareMP: false,
				my_pp_uuid: "",
				timeout: null,
				startTime: 0,
				videoLsit: [],
				totalPages: [],
				isShare: false,
				local_video_id: "",
				local_video_showId: "",
				type_mute: 0,
				isDragging: false, // 标记是否正在拖动
				     startX: 0, // 初始X坐标
				     startY: 0, // 初始Y坐标
				     elementX: '', // 元素当前X坐标
				     elementY: '', // 元素当前Y坐标
				isClick:true,
				



				hindex: "",
				pindex: "",
				xiandata: [1, 3, 6, 8],
				colodedata: ['#191919', '#F05861', '#FFC303', '#27E17A', '#8C2DD6', '#43C4FF', '#165FFF'],
				kindex: -1,
				gxdata: [{
						txt: "收起",
						img: "/static/img/shouqi.png"
					},
					{
						txt: "画笔",
						img: "/static/img/huabi.png"
					},
					{
						txt: "橡皮",
						img: "/static/img/xiangpi.png"
					},
					{
						txt: "清除",
						img: "/static/img/qingchu.png"
					},
					{
						txt: "保存",
						img: "/static/img/baocun.png"
					}
				],
				iswhite: false,
				thistime: "",
				textContent: '',
				ishuahua: false,
				yindex: 0,
				showclode: false,
				slideryin: 30,
				isyangshen: false,
				isinfo: false,
				hhg: "",
				mlist: [],
				iscam: true,
				ismic: true,
				meetingInfo: {}
			}
		},
		computed: {
			yinbumber() {
				var aa = 0
				this.clist.map(item => {
					if (item.is_muted) {
						aa++
					}
				})
				return aa
			},
			mlistlength() {
				return this.mlist.length
			}
		},
		onShow() {

			// window.flutter_inappwebview.callHandler('setActionBar', 'pure', '', true, '', '', 'handleBack()','handleClickclose()').then(function(result) {
			// 	console.log('result: ' + result);
			// })
			uni.$off('onLogOut')
			uni.$on('onLogOut', res => {
				this.$refs.upLogOut.show()
			})
			uni.$off('updateMsg')
			uni.$on('updateMsg', (data) => {
				this.audioinput = audioinput
				this.videoLsit=videoLsit
			})
			
			if (window.flutter) {
				flutter.call('setActionBar', {
					type: 'pure',
					title: "",
					isWhite: true,
					onDownloads: "",
					onSettings: '',
					onBack: 'handleBack()',
					onClose: 'handleClickclose()'
				}, (result, error) => {})
			}

			window.handleBack = () => {
				this.back()
			}
			window.handleClickclose = () => {
				uni.$emit('exitclose')
				this.$refs.showtishi.show()
			}

		},
		onReady() {

			uni.onWindowResize((res) => {
				console.log("4444")
				this.hhg = res.size.windowHeight - 130
				this.WidthH()
				this.getVideoW('#local_width').then(res => {
					this.Width = res
				})
			});
		},
		onLoad(option) {
			this.windowMax = windowMax
			let startTime = new Date();

			setInterval(() => {
				this.updateTime(startTime)
			}, 1000)
			this.type = option.type

			this.hhg = uni.getSystemInfoSync().windowHeight - 130

			this.iscam = iscam
			this.ismic = ismic
			loginMgr.put_self_status('2')


		},
		mounted() {
			console.log(checkboxCam, "yyyyyyy")
			if (getCurrentPages().length == 1) {
				this.likaihui()

				return
			}

			this.my_pp_uuid = zjsdk3.call.my_pp_uuid
			
			this.audioinput = audioinput

			if (audiooutput.length) {
				this.audiooutputValue = audiooutput[0].device_id
			}
			this.videoLsit = videoLsit

			if (!iscam) {
				if (!videoLsit.length) {
					window.iscam = true
					this.iscam = true
					this.mute_title = '未监测到摄像头'
					this.$refs.upMute.show()
				}
			}
			if(!ismic){
				if(!audioinput.length){
					window.ismic=true
					this.ismic = true
					this.mute_title='未监测到麦克风'
					this.$refs.upMute.show()
				}
			}
			
			zjsdk3.local_dev_mute_cam(this.iscam)
			zjsdk3.local_dev_mute_mic(this.ismic)
			setTimeout(() => {
				console.log(ismic, "aaaaass", typeof ismic)
			}, 3000)


			zjsdk3.on_dev_call_disconnected = (reason) => {
				console.log(reason, "rrrrrr")
				if (reason == 'Call disconnected') {
					//Call disconnected,语出
					uni.hideLoading()
					this.$refs.likai.show()
				}

				if (reason == 'User initiated disconnect') {
					uni.hideLoading()
					//User initiated disconnect  主持人会议结束
					this.$refs.likai.show()
				}
				console.log("22222222222")


			}

			zjsdk3.on_dev_conference_info_changed = (cinfo, changed_keys) => {
				this.meetingInfo.name = cinfo.conf_name
				this.meetingInfo.join_pwd = cinfo.guest_pwd
				this.meetingInfo.mr_id = cinfo.mr_id
				console.log(cinfo, "ssssss", changed_keys)

				this.changed_key = changed_keys[0]

				this.format(cinfo.real_launch_dtm * 1000)
			}

			zjsdk3.on_dev_chat_message = (from_uuid, message, nickname, is_private) => {
				var info = {
					name: nickname,
					msg: message,
					time: new Date().getTime()
				}
				this.allinfo.push(info)
				this.allnumberchat++

			}

			zjsdk3.on_dev_unmute_please = (equestor_uuid, reason) => {
				console.log("mmmmmmm", equestor_uuid, reason)
				this.video_list.map(item => {
					if (item.uuid == equestor_uuid) {
						this.isclen = 1
						this.type_mute = 3
						this.mute_title = '主持人请求您开启麦克风'
						this.$refs.upMute.show()
					}
				})
			}
			zjsdk3.on_dev_participant_update = (participant, changed_keys) => {
				console.log("ttttt", participant, changed_keys)
				this.changed_key = ''

				if (this.my_pp_uuid == participant.uuid) {

					if (changed_keys[0] != 'focus_stat') {
						if (changed_keys[0] == 'is_muted') {
							if (participant.is_muted) {
								zjsdk3.local_dev_mute_mic(true)
								this.ismic = true
								this.mute_title = '您已被主持人静音，如需发言请开启麦克风'
								this.$refs.upMute.show()
							}
						}
						if (changed_keys[0] == 'role') {
							if (participant.role == "chair") {
								this.mute_title = '您已被赋予主持人权限'
							} else {
								this.mute_title = '您已被取消主持人权限'
							}
							this.$refs.upMute.show()
						}

					} else {
						return
					}

					if (participant.role == "chair") {
						this.ischair = true
					}
					if (participant.role == "guest") {
						this.ischair = false
					}

				}



				if (participant.is_speaking && participant.protocol != "rtsp") {

					this.speaking = participant.display_name


					// let itemToMove
					// let video_id = []
					// let arr_uuids = []

					// let list = this.video_list

					// list.map((item, index) => {
					// 	if (item.data.is_speaking) {
					// 		itemToMove = item
					// 		list.splice(index, 1)
					// 		list.unshift(itemToMove)

					// 		video_id.unshift('afarend_video' + item.index)
					// 		arr_uuids.unshift(item.data.uuid)

					// 	} else {
					// 		video_id.push('afarend_video' + item.index)
					// 		arr_uuids.push(item.data.uuid)
					// 	}
					// })

					// this.video_list = list
					// zjsdk3.show_video_by_uuids(video_id, arr_uuids)

					this.lidhui(participant)
					let list = []
					this.video_list.map(item => {
						list.push({
							name: item.display_name,
							avatar: "",
							isTalking: item.is_speaking,
							microphoneOn: item.is_muted
						})
					})

					var data = {
						talkingName: participant.display_name,
						list
					}
					flutter.call('attendeeListWindow', {
						windowId,
						data
					}, (result, error) => {
						if (error) {
							updateResult(error, true);
							return;
						}
						updateResult(`
					    <strong>${result}</strong>
					  `);
					});
					return
				} else {
					this.speaking = ''
				}

				// let newlist = this.clist
				// newlist.map(item => {
				// 	if (participant.uuid == item.uuid) {
				// 		item = participant
				// 	}
				// })
				// this.clist = []
				// this.clist = newlist
				console.log(11111112222)
				this.lidhui()
			}

			zjsdk3.on_dev_participant_new = (participant) => {
				//有人加入
				console.log("gggg1", participant)
				if (this.my_pp_uuid == participant.uuid) {
					if (participant.role == "chair") {
						this.ischair = true
					}
					if (participant.role == "guest") {
						this.ischair = false
					}
				}



				this.lidhui()



				// zjsdk3.show_video_by_orders(['farend_video0', 'farend_video1', 'farend_video2', 'farend_video3', 'farend_video4'])
			}

			zjsdk3.on_dev_participant_delete = (participant) => {
				//有人退回
				console.log("kkk", participant)
				this.lidhui()
				// this.clist.map((item, index) => {
				// 	if (participant.uuid == item.uuid) {
				// 		this.clist.splice(index, 1)
				// 	}
				// })

			}


			zjsdk3.show_video_by_content('huixian')
			zjsdk3.on_dev_presentation_event = (is_start, sender_uuid) => {
				if (is_start) {
					this.shareMP = true
					uni.hideLoading()
					this.$refs.goxnag.close()
					this.mlist.map(item => {
						if (sender_uuid == item.uuid) {
							this.shareevent = item
						}
					})
					console.log("LLLLL", is_start, sender_uuid)
					setTimeout(() => {
						zjsdk3.share_whiteboard_join_pizhui('whiteboard')
					}, 1000)

				} else {
					this.shareMP = false
					this.allclose()
					this.endShare()
				}
			}

			//zjsdk3.local_dev_show_myvideo(['local_video'], checkboxCam) // 回显本地视频
			this.getVideoW('#local_width').then(res => {
				this.Width = res
			})

			if (flutter) { //设置
				flutter.call('getVolume', {}, (result, error) => {
					this.slideryin = Math.round(result * 100)
				})
			}
		},
		computed: {
			comparedItems() {
				 return this.allinfo.map((item, index, array) => {
					if(index>0){
						if(item.time - array[index - 1].time > 600000){
							return this.timeTamp(item.time/1000)
						}
					}else{
						return this.timeTamp(Date.now()/1000)
					}
				})
			}
		},
		methods: {
			onExpand(){
				console.log("111111")
				if(this.isClick){
					this.isquanvideo=false
					this.iscide=true 
				}
			},
			onUp(){
				console.log("ffff")
				if(this.isDragging){
					this.isClick=true
					this.isDragging = false;
				}
			},
			onDown(e){
				console.log("22222")
				  this.isDragging = true; // 开始拖动
				  this.startX = event.clientX - this.elementX; // 鼠标起始位置与元素当前位置的差值
				  this.startY = event.clientY - this.elementY; // 同上，Y轴方向
			},
			onMove(e){
				if (this.isDragging) { // 如果正在拖动，则更新元素位置
				this.isClick=false
				this.elementX = event.clientX - this.startX; // 计算新的X坐标
				this.elementY = event.clientY - this.startY; // 计算新的Y坐标
				this.updateElementPosition(); // 更新元素位置到DOM中
			  }
			},
			updateElementPosition() {
			  const draggable = this.$el.querySelector('.draggable'); // 获取元素引用，这里使用了原生DOM查询，因为uni-app的$refs在某些情况下可能不工作或需要额外的设置才能正确获取到元素。确保你的uni-app版本支持这种方式或者使用其他方法（如设置ref）。如果使用ref，确保在template中设置了ref属性。例如：<view class="draggable" ref="draggable" ...>。然后使用this.$refs.draggable来获取元素。
			  draggable.style.transform = `translate3d(${this.elementX}px, ${this.elementY}px, 0)`; // 使用transform来移动元素，而不是直接修改left/top属性，因为transform的性能通常更好。
			},
			textShare() {
				if (this.shareMP) {
					this.mute_title = '其他人正在共享，请稍后开启共享!'
					this.$refs.upMute.show()
					return
				}
				this.$refs.goxnag.open()
			},
			onDoubleClick(item) {
				if (item) {
					this.isVideo = true
					this.isfirst = true
					let arr = []
					this.local_video_view=item
					this.local_video_showId = item.uuid
					this.lidhui()
					
					//zjsdk3.show_video_by_uuids(['local_video1',...this.videoShow], [item.uuid,...this.videoShowUuid]) 
				} else {
					this.isVideo = false
					this.isfirst = false
					this.local_video_showId = ''
					this.lidhui()
					
					//zjsdk3.show_video_by_uuids(this.videoShow, this.videoShowUuid)
				
				}

			},
			onVideoTab(item) {
				const now = Date.now();
				const DOUBLE_CLICK_TIME = 300;
				if (this.timeout) {
					clearTimeout(this.timeout);
					this.timeout = null;
					if (now - this.startTime < DOUBLE_CLICK_TIME) {
						this.onDoubleClick(item);
					} else {
						this.startTime = now;
					}
				} else {
					this.timeout = setTimeout(() => {
						this.timeout = null;

					}, DOUBLE_CLICK_TIME);
					this.startTime = now;
				}

			},
			onVoice() {
				this.voice = true
				this.voice_video = false
				this.voice_video_all = false
			},
			onVoiceVideo() {
				this.voice = false
				this.voice_video = true
				this.voice_video_all = false
			},
			onVoiceeVideoAll() {
				this.voice = false
				this.voice_video = false
				this.voice_video_all = true
			},
			onMax() {
				let that = this
				if (this.windowMax) {
					flutter.call('unMaximize', {}, (result, error) => {
						windowMax = false
						that.windowMax = false
					});
				} else {
					flutter.call('maximize', {}, (result, error) => {
						windowMax = true
						that.windowMax = true
					});
				}
			},
			onMin() {
				flutter.call('minimize', {}, (result, error) => {});
			},
			onClose() {
				this.$refs.showlikai.show()
			},
			likaimeeting() {
				this.lgoin()
			},
			lgoin() {
				if (uni.getStorageSync('token')) {
					uni.reLaunch({
						url: "/pages/index/index"
					})
				} else {
					uni.reLaunch({
						url: "/pages/index/login"
					})
				}
			},
			getVideoW(id) {
				return new Promise((resolve, reject) => {
					const query = uni.createSelectorQuery().in(this);
					query.select(id).boundingClientRect((data) => {
						if (data) {
							resolve(data.width)
						}
					}).exec();
				})
			},


			textFocus() {
				this.allnumberchat = 0
			},


			tapYaoqing() {
				this.$refs.upInvite.open()
			},
			tapSound() {
				this.issound = !this.issound

				if (this.issound) {
					zjsdk3.local_dev_set_speaker_volume(0.5, this.audiooutputValue)
					this.slideryin = 50
				} else {
					zjsdk3.local_dev_set_speaker_volume(0, this.audiooutputValue)
					this.slideryin = 0
				}

			},
			exitChange() {
				this.isclen = 0
			},
			async gethuiyi() {
				uni.showLoading()
				var mis = await zjsdk3.buffet_askfor_host(this.mimahuiyis)
				if (mis.status == "failed") {
					uni.showToast({
						title: "无效密码",
						icon: "none"
					})
				} else {
					uni.hideLoading()
					this.$refs.zhuchimima.close()
					// this.ischair = true
				}
			},
			tapquanping(index) {
				this.isquan = index
				console.log(index)
				if (index == 1) {
					this.iscide = true
					this.dongwidth = 0
					this.lidhui()

					// this.donghuamin()

					console.log("dddwwwww")
					flutter.call('setFullScreen', {
						isFullScreen: true
					}, (result, error) => {

					});
				} else {
					this.isquanvideo = false
					this.iscide = false
					this.lidhui()

					// this.donghuamin()
					flutter.call('setFullScreen', {
						isFullScreen: false
					}, (result, error) => {});
				}

			},
			switch_mic(item) {
				zjsdk3.local_dev_switch_mic(item.device_id)
				this.ismsmic = false
			},
			switch_cam(item) {
				zjsdk3.local_dev_switch_cam(item.device_id)
				this.isCamera = false
			},
			WidthH() {

				setTimeout(() => {
					this.getVideoW('#local_width').then(res => {
						this.Width = res
						setTimeout(() => {
							zjsdk3.share_whiteboard_change_size(() => {})
						}, 100)
					})
				}, 100)
			},
			donghuamin() {
				if (this.dongwidth == 'auto') {
					this.dongwidth = 0
				} else {
					this.dongwidth = 'auto'
				}
				// if(this.gx==1){
				this.WidthH()
				// }
			},
			async butfasong() {
				var info = {
					name: "",
					msg: "",
					time: Date.now()
				}
				await zjsdk3.buffet_send_chat_message(this.textinfo, [])
				info.msg = this.textinfo
				this.allinfo.push(info)
				this.textinfo = ''

				console.log(this.allinfo)

				// c78d0dba-f5a1-11ef-a0a6-000c2989851e 发v恶风 3f false kkj
			},
			saosao() {
				if (this.aindex == 1) {
					if (this.cname) {
						var sdf = []
						this.clist.filter(item => {
							if (item.display_name.toLowerCase().includes(this.cname.toLowerCase())) {
								sdf.push(item)
							}
						})
						this.clist = sdf
					} else {
						let sdf = []
						this.mlist.map(item => {
							if (item.is_muted) {
								sdf.push(item)
							}
						})
						this.clist = sdf
					}

				} else {
					if (this.cname) {
						var sdf = []
						this.mlist.filter(item => {
							if (item.display_name.toLowerCase().includes(this.cname.toLowerCase())) {
								sdf.push(item)
							}
						})
						this.clist = sdf
					} else {
						this.clist = this.mlist
					}
				}



			},
			tapcan() {

				this.bgChat = false
				if (this.yindex == 1) { //参会者
					console.log(333)
					if (this.iscanhui) {
						this.dongwidth = 0
						//this.iscanhui = false
					} else {
						this.dongwidth = 'auto'
						//this.cindex = 0
						//this.iscanhui = true
						this.getVideoW('#local_width').then(res => {
							console.log(res, "ccccc")
							this.w_view = this.Width - 350
						})
					}
				} else {
					console.log(2222)
					this.dongwidth = 'auto'
					this.WidthH()
					// this.bgParticipation=!this.bgParticipation
					// if(this.bgParticipation){
					// 	this.iscanhui = true
					// 	this.cindex = 0
					// }else{
					// 	this.iscanhui = false
					// }
				}
				this.bgParticipation = !this.bgParticipation
				if (this.bgParticipation) {
					this.iscanhui = true
					this.cindex = 0
				} else {
					this.iscanhui = false
				}
			},
			allchat() {


				this.bgChat = !this.bgChat

				if (this.bgChat) {
					this.cindex = 1
					this.iscanhui = true
				} else {
					this.iscanhui = false
				}

				this.bgParticipation = false
				this.dongwidth = 'auto'
				this.WidthH()

				// this.iscanhui = true
				this.cindex = 1
				this.allnumberchat = 0

			},
			async quename() {
				await zjsdk3.host_set_participant_name(this.uuid, this.turname)
				this.$refs.setname.close()
			},
			async tapdanjingyin(item) {
				if (item.protocol == 'rtsp') {
					if (item.local_audio || item.is_muted) {
						zjsdk3.host_mute_participant_audio(item.uuid, false)
					} else {
						zjsdk3.host_mute_participant_audio(item.uuid, true)
					}
				} else {
					if (item.local_audio) {
						if (item.uuid == this.my_pp_uuid) {
							zjsdk3.local_dev_mute_mic(false)
							if(this.audioinput.length){
								this.ismic = false
							}else{
								this.mute_title='未监测到麦克风'
								this.$refs.upMute.show()
							}
						} else {
							await zjsdk3.host_mute_participant_audio(item.uuid, false)
						}
					} else {
						if (item.uuid == this.my_pp_uuid) {
							zjsdk3.local_dev_mute_mic(true)
							this.ismic = true
						} else {
							await zjsdk3.host_mute_participant_audio(item.uuid, true)
						}
					}
				}

			},

			gaiming() {
				this.turname = this.dianitem.display_name
				this.$refs.setname.open()
			},
			async sheweizhuchi(item) {
				if (item.role == "chair") {
					await zjsdk3.host_set_participant_host(item.uuid, false)
				} else {
					await zjsdk3.host_set_participant_host(item.uuid, true)
				}

			},
			async yuchu() {
				await zjsdk3.host_disconnect_participant(this.uuid)
				this.$refs.huiyi.close()
			},
			canhui(item, index) {
				this.mindex = index
			},
			tapbdian(item, index) {
				console.log(item, index)
				this.dianitem = item
				this.uuid = item.uuid
				this.isjing = index
				this.iyin = !this.iyin
			},
			promptConfirm() {
				if (this.type_mute == 1) {
					uni.showLoading({
						mask:true
					})
					setTimeout(()=>{
						uni.hideLoading()
					},1000)
					zjsdk3.local_dev_mute_mic(true)
					zjsdk3.host_mute_all_guests(true)
					this.ismic = true
					this.yin = '全体静音'
					this.isyin = false
				}
				if (this.type_mute == 2) {
					uni.showLoading({
						mask:true
					})
					setTimeout(()=>{
						uni.hideLoading()
					},1000)
					this.ismic = false
					zjsdk3.local_dev_mute_mic(false)
					zjsdk3.host_mute_all_guests(false)
					this.yin = '全体不静音'
					this.isyin = false
				}
				if (this.type_mute == 3) {
					zjsdk3.local_dev_mute_mic(false)
					this.ismic = false
				}

				this.type_mute = 0
			},
			yesyin() {
				this.type_mute = 1
				this.mute_title = '所有参会人将被您静音!'
				this.$refs.upMute.show()
			},
			noyin() {
				this.type_mute = 2
				this.mute_title = '所有参会人被您解除静音!'
				this.$refs.upMute.show()
			},
			tapjingyin() {
				this.isyin = !this.isyin
			},
			tapkin(index) {
				this.aindex = index
				if (index) {
					let sdf = []
					this.mlist.map(item => {
						if (item.is_muted) {
							sdf.push(item)
						}
					})
					this.clist = sdf

				} else {
					this.clist = this.mlist
				}
			},
			canshu(index) {
				this.cindex = index
				if (index == 1) {
					this.bgParticipation = false
					this.bgChat = true
				} else {
					this.bgParticipation = true
					this.bgChat = false
				}
			},

			gxpdf() {
				this.gx = 3
				this.imglist = []
				uni.chooseImage({
					count: 1,
					type: 'file',
					extension: ['pdf'],
					success: (res) => {

						for (var i = 0; i < res.tempFiles.length; i++) {
							if (res.tempFiles[i].type != 'application/pdf') {
								uni.showToast({
									title: "选择pdf文件",
									icon: "none"
								})
								return
							}
						}
						this.pdffiles = res.tempFiles[0]

						console.log("ttttt", res)

					}
				})
			},
			stoerxiang() {
				this.thatimg = 1
				this.isShare = true
				if (this.gx == 0) {
					// this.shareMP = true
					zjsdk3.share_screen_start()
					console.log("eeeeee")
					const title = this.meetingInfo.name + this.meetingInfo.mr_id

					if (window.flutter) {
						flutter.call('shareScreenWindow', {
							title
						}, (result, error) => {
							console.log(result, 'yyyyy', error)
							if (error) {
								uni.showToast({
									title: error,
									icon: "none"
								})
								return;
							}
						});
					}


				} else if (this.gx == 1) {
					uni.showLoading()
					this.shareMP = true
					this.getVideoW('#local_width').then(res => {
						this.Width = res
						zjsdk3.share_whiteboard_start('whiteboard')
						uni.hideLoading()
						// setTimeout(()=>{
						//  zjsdk3.share_whiteboard_join_pizhui('whiteboard')
						//  zjsdk3.share_screen_pizhu_start()
						// },3000)
					})
				} else if (this.gx == 2) {
					if (this.imglistfile.length) {
						uni.showLoading()
						this.shareMP = true
						zjsdk3.share_whiteboard_allowshare()

						zjsdk3.share_img_start(this.imglistfile, null, 'whiteboard')
						document.getElementById('image_canvas').hidden = false;
						setTimeout(() => {
							document.getElementById('image_canvas').hidden = true;
						}, 500)

					} else {
						uni.showToast({
							title: "选择图片",
							icon: "none"
						})
					}
				} else {
					if (this.pdffiles) {
						this.shareMP = true
						zjsdk3.share_pdf_start(this.pdffiles, null, 'whiteboard')
						setTimeout(() => {
							var loadingTask = pdfjsLib.getDocument(this.pdffiles.path)
							loadingTask.promise.then((pdf) => {
								this.numpage = pdf.numPages
							})
						}, 1000)

					} else {
						uni.showToast({
							title: "请选择",
							icon: "none"
						})
					}
				}

			},
			upchange(e) {
				if (e.show) {
					this.allclose()
				}
			},
			allclose() {
				this.numpage = 1
				this.imglist = []
				this.imglistfile = []
				this.pdffiles = ''
			},
			imgNext() {
				if (this.gx == 2) {
					if (this.thatimg == this.imglistfile.length) {
						return
					}
					this.thatimg++
					zjsdk3.share_img_next_page()
				} else if (this.gx == 3) {
					if (this.numpage == this.thatimg) {
						return
					}
					this.thatimg++
					zjsdk3.share_pdf_next_page()
				}

			},
			imgPrivious() {
				if (this.thatimg == 1) {
					return
				}
				this.thatimg--

				if (this.gx == 2) {
					zjsdk3.share_img_privious_page()
				} else if (this.gx == 3) {
					zjsdk3.share_pdf_privious_page()
				}

			},
			endShare() { //结束共享
				this.isShare = false
				zjsdk3.share_xxx_stop()
			},
			setimg() {
				this.pdffiles = ''
				this.gx = 2
				uni.chooseImage({
					count: 5,
					sizeType: ['original', 'compressed'],
					sourceType: ['album'],
					success: (res) => {
						this.imglist = [...this.imglist, ...res.tempFilePaths]
						this.imglistfile = [...this.imglistfile, ...res.tempFiles]
						console.log(this.imglistfile, "hhh", res)


						this.iswhite = true
						var image_canvas = document.getElementById("image_canvas");
						var image_canvas_ctx = image_canvas.getContext('2d');
						var image = new Image();

						var freader = new FileReader();

						freader.onload = () => {


							if (timer_refresh_img) {
								clearInterval(timer_refresh_img);
								timer_refresh_img = null;
								image.src = '';
							}

							console.log(freader, "pp")

							timer_refresh_img = setInterval(() => {
								image.src = freader.result;
								image_canvas_ctx.drawImage(image, 0, 0, 960,
									540); // 由于发给无端的流是从canvas抓出来的,因此canvas应该使用1920*1080才合理
							}, 300)

							console.log("rrrrrr", image)

							window.setPropForVideo("image_video", image_canvas.captureStream(5));

						}

						console.log(res.tempFiles[0], "ggg")

						freader.readAsDataURL(res.tempFiles[0]);


					}
				});
			},
			tapisqingchu(index) {
				this.isqingchu = false
				zjsdk3.share_whiteboard_use_rubber()
				if (index == 0) {
					zjsdk3.share_whiteboard_clear_all_path()
				} else if (index == 1) {
					zjsdk3.share_whiteboard_clear_self_path()
				} else {
					zjsdk3.share_whiteboard_clear_other_path()
				}
			},
			colodemouseleave() {
				this.iscolore = false
			},
			tapxian(item, index) {
				this.hindex = index
				this.xianitem = item
				zjsdk3.share_whiteboard_use_pen(item, this.pitemcolor)
			},
			tapcolode(item, index) {
				this.pindex = index
				this.pitemcolor = item
				zjsdk3.share_whiteboard_use_pen(this.xianitem, item)
			},
			async tapgong(index) {
				if (index != 0) {
					this.kindex = index
				}
				if (index != 1) {
					this.iscolore = false
				}
				if (index != 3) {
					this.isqingchu = false
				}
				this.gxdata = [{
						txt: "收起",
						img: "/static/img/shouqi.png"
					},
					{
						txt: "画笔",
						img: "/static/img/huabi.png"
					},
					{
						txt: "橡皮",
						img: "/static/img/xiangpi.png"
					},
					{
						txt: "清除",
						img: "/static/img/qingchu.png"
					},
					{
						txt: "保存",
						img: "/static/img/baocun.png"
					}
				]

				console.log(index)
				if (index == 0) {
					this.ismokaui = false
					this.iscolore = false
				} else if (index == 1) {
					zjsdk3.share_whiteboard_toggle_pen(1)
					this.iscolore = !this.iscolore
					zjsdk3.share_whiteboard_use_pen(this.xianitem, this.pitemcolor)
					this.gxdata[index].img = '/static/img/huabis.png'
				} else if (index == 2) {
					zjsdk3.share_whiteboard_use_rubber()
					this.gxdata[index].img = '/static/img/xiangpis.png'
				} else if (index == 3) {
					this.isqingchu = !this.isqingchu
					this.gxdata[index].img = '/static/img/qingchus.png'
				} else {
					this.gxdata[index].img = '/static/img/baocuns.png'
					var imurl = await zjsdk3.share_whiteboard_get_img()
					var blob = base64ToBlob(imurl);
					var downloadLink = document.createElement('a');
					downloadLink.href = URL.createObjectURL(blob);
					downloadLink.download = 'image.png';
					downloadLink.click();
					URL.revokeObjectURL(downloadLink.href);
				}
			},


			// audioyin(item) {

			// 	if (item.is_muted) {
			// 		zjsdk3.host_mute_participant_audio(item.uuid, false)
			// 	} else {
			// 		zjsdk3.host_mute_participant_audio(item.uuid, true)
			// 	}

			// },
			format(dataString) {
				//dataString是整数，否则要parseInt转换
				var time = new Date(dataString);
				var year = time.getFullYear();
				var month = time.getMonth() + 1;
				var day = time.getDate();
				var hour = time.getHours();
				var minute = time.getMinutes();
				var second = time.getSeconds();
				this.thistime = year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
					' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute) + ':' + (second <
						10 ? '0' + second : second)
			},
			updateTime(startTime) {
				const currentTime = new Date();
				const elapsedTime = currentTime - startTime;

				// 计算时分秒
				const hours = Math.floor(elapsedTime / (1000 * 60 * 60));
				const minutes = Math.floor((elapsedTime % (1000 * 60 * 60)) / (1000 * 60));
				const seconds = Math.floor((elapsedTime % (1000 * 60)) / 1000);

				// 格式化时间并显示
				this.textContent =
					`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
			},

			taphua() {
				this.ishuahua = !this.ishuahua
			},
			hualang() {
				this.bgParticipation = false
				this.bgChat = false

				this.yindex = 1
				this.ishuahua = false
				this.dongwidth = 0
				this.getVideoW('#w_view').then(res => {
					this.w_view = res
					console.log(this.w_view, "hhh")
					this.lidhui()
				})
			},
			yanjiang() {
				this.ishuahua = false
				this.yindex = 0
				this.dongwidth = 'auto'
				this.lidhui()
			},
			getCls() {
				let cls
				if (this.mlist.length == 2) {
					cls = 'screen2-'
				} else if (this.mlist.length == 3) {
					cls = 'screen3-'
				} else if (this.mlist.length == 4) {
					cls = 'screen4-'
				} else if (this.mlist.length == 5) {
					cls = 'screen5-'
				} else if (this.mlist.length == 6) {
					cls = 'screen6-'
				} else if (this.mlist.length == 7) {
					cls = 'screen7-'
				} else if (this.mlist.length == 8) {
					cls = 'screen8-'
				} else {
					cls = 'screen9-'
				}
				// if (this.mlist.length > 8){
				// 	cls = 'screen9-'
				// 	this.totalPages =[]
				// 	let Pages = Math.ceil(this.mlist.length / 9)
				// 	let arr =[]
				// 	for(var i=0;i<Pages*9;i++){
				// 		arr.push(i)
				// 	}
				// 	let size = 9;
				// 	let result = Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
				// 	  return arr.slice(i * size, i * size + size);
				// 	});
				// 	this.totalPages = result
				// 	console.log(this.totalPages,"mmmmmmm")
				// }
				return cls
			},

			lidhui(participant, uuid) {
				var amlist = zjsdk3.get_all_participants()
				var pk = []
				for (let [key, value] of amlist) {
					pk.push(value)
				}

				if (!pk.length) { //如果没用户信息，停止操作return
					return
				}

				this.mlist = pk //先加载video

				console.log(pk, "jjjj")

				let ids = []
				let amlistOther = []
				let selfUser = []
				let chair = []
				let is_speaking = []
				let HasVideo = []
				this.mlist.map((item, index) => {


					if (participant && participant.uuid == item.uuid) {
						is_speaking.push(item)
					} else {
						if (item.uuid == this.my_pp_uuid) {
							selfUser.push(item)
						} else if (item.role == 'chair') {
							chair.push(item)
						} else if (item.uuid == this.local_video_showId) {
							HasVideo.push(item)
						} else {
							amlistOther.push(item)
						}
					}

				})


				this.tahtinfo = ""
				this.video_list = []
				let amlistTemp = []
				if (is_speaking.length) {
					amlistTemp = [...selfUser, ...is_speaking, ...chair, ...HasVideo, ...amlistOther] //把我，主持人,参会者进入排序
				} else {
					amlistTemp = [...selfUser, ...chair, ...HasVideo, ...amlistOther] //把我，主持人,参会者进入排序
				}
				let cls
				if (!this.iscanhui) {
					cls = 'farend_video' //参会人视频id
				}
				if (this.yindex == 1) {
					cls = this.getCls()
				}
				if (this.isquan == 1) {
					cls = 'afarend_video'
				}
				let videoShowUuid = []
				let videoShow = []
				let monitor = []
				console.log(cls, "gggggg", amlistTemp)
				amlistTemp.map((item, i) => {
					// this.amlist.push({
					// 	pkey: i,
					// 	...item
					// }) //画廊数组，添加主列表index
					
					// if(item.protocol == 'rtsp') { //如何是监控视频
					// 	monitor.push(item)
					// }

					if (this.aindex == 1) {
						let dismic = []
						if (item.is_muted) {
							dismic.push(item)
						}
						this.clist = dismic //静音
					} else {
						this.clist = amlistTemp //全部
					}


					if (item.uuid != this.my_pp_uuid) { //找出所有非当前用户
						videoShow.push((cls + i))
						this.video_list.push(item)
						videoShowUuid.push(item.uuid)
					} else {
						this.tahtinfo = item
					}

				})

				console.log(this.video_list, "yyyy", this.tahtinfo, "ccc2")

				if (this.mlist.length == 1) {
					zjsdk3.show_video_by_orders(['fous_arend_video'])

				}
				// if(this.isquan==1){//显示自己

				// }
				zjsdk3.local_dev_show_myvideo(['local_video_all', 'local_video']) //显示自己

				setTimeout(() => {

					if (HasVideo.length && this.isfirst) {
						this.isVideo = true //有视频

						//this.local_video_id = 'local_video1'
						if (!this.local_video_showId) {
							this.local_video_showId = HasVideo[0].uuid
						}
						
						//this.isfirst = false
						this.videoShow = ['local_video1', ...videoShow]
						this.videoShowUuid = [this.local_video_showId, ...videoShowUuid]
					} else {
						
						this.isVideo = false //无视频
						this.videoShow = videoShow
						this.videoShowUuid = videoShowUuid
						//zjsdk3.show_video_by_uuids(this.videoShow, this.videoShowUuid)  //把所有用户除自己外的视频绑定到画廊里/
					}



					zjsdk3.show_video_by_uuids(this.videoShow, this.videoShowUuid) //把所有用户除自己外的视频绑定到画廊里/
					if (this.yindex == 1) {
						zjsdk3.local_dev_show_myvideo([cls + '0'], checkboxCam) //
					} else {}
					
					// if(monitor.length) {  //如果有监控视频，需要放大一下，不然显示不出来
					// 	zjsdk3.buffet_stick_uuid(monitor[0].uuid)
					// }
				}, 10)

				if (this.shareMP) { //共享屏幕数据 
					let list = []
					this.clist.map(item => {
						list.push({
							name: item.display_name,
							avatar: "",
							isTalking: item.is_speaking,
							microphoneOn: item.is_muted
						})
					})

					var data = {
						talkingName: participant ? participant.display_name : '',
						list
					}

					if (window.flutter) {
						flutter.call('attendeeListWindow', {
							windowId,
							data
						}, (result, error) => {
							if (error) {
								updateResult(error, true);
								return;
							}
							updateResult(`
					    <strong>${result}</strong>
					  `);
						});
					}
				}




			},
			handleMouseEnter() {
				this.showclode = true
			},
			handleMouseLeave() {
				this.showclode = false
			},
			openvideo() {

				// if (this.iscam) {
				// 	zjsdk3.local_dev_mute_cam(false)
				// } else {
				// 	zjsdk3.local_dev_mute_cam(true)
				// }
				// this.iscam = !this.iscam

				if(this.videoLsit.length){
					uni.showLoading({
						mask:true
					})
					setTimeout(()=>{
						uni.hideLoading()
					},1000)
					if (this.iscam) {
						zjsdk3.local_dev_mute_cam(false)
					} else {
						zjsdk3.local_dev_mute_cam(true)
					}
					this.iscam = !this.iscam
				}else{
					uni.showToast({
						title:"未检测到摄像头",
						icon:"none"
					})
				}

			},
			jiechuyin() {

				if (this.audioinput.length) {
					uni.showLoading({
						mask:true
					})
					setTimeout(()=>{
						uni.hideLoading()
					},1000)
					if (this.ismic) {
						zjsdk3.local_dev_mute_mic(false)
					} else {
						zjsdk3.local_dev_mute_mic(true)
					}
					this.ismic = !this.ismic
				} else {
					uni.showToast({
						title: "未检测到麦克风设备",
						icon: "none"
					})
				}

			},
			minyin() {
				zjsdk3.local_dev_set_speaker_volume(0, this.audiooutputValue)
				this.slideryin = 0
			},
			maxyin() {
				zjsdk3.local_dev_set_speaker_volume(100, this.audiooutputValue)
				this.slideryin = 100
			},
			inputslider(e) {
				zjsdk3.local_dev_set_speaker_volume(e / 100, this.audiooutputValue)
			},
			showinfo() {
				this.isinfo = !this.isinfo
			},
			tapshowyang() {
				this.isyangshen = !this.isyangshen
			},

			likaihui() {


				// zjsdk3.local_dev_show_myvideo([], true)
				console.log("1111")
				zjsdk3.local_dev_mute_cam(true)
				zjsdk3.local_dev_mute_mic(true)
				zjsdk3.disconnect_now('reason')
				if (uni.getStorageSync("token")) {
					uni.reLaunch({
						url: "/pages/index/index"
					})
				} else {
					uni.reLaunch({
						url: "/pages/index/login"
					})
				}

				zjsdk3.preview_dev_finished()
			},

			async jieshu() {
				uni.showLoading({
					mask: true,
					title: "正在结束中..."
				})
				await zjsdk3.host_end_conference()
				// zjsdk3.local_dev_show_myvideo([], true)
				zjsdk3.local_dev_mute_cam(true)
				zjsdk3.local_dev_mute_mic(true)
				this.$refs.showjieshu.close()
				// uni.reLaunch({
				// 	url: "/pages/index/index"
				// })
				zjsdk3.preview_dev_finished()
			}
		}
	}
</script>

<style>
	page {
		background: #2c2c2c;
	}

	/deep/ .el-tree-node__content {
		height: 50px;
		/* 设置你想要的节点高度 */
	}


	/deep/ .el-tree-node__expand-icon {
		color: #165DFF;
	}

	.clsvideo2 {
		width: 49.5%;
		margin-top: 380rpx;
		height: 49%;
	}

	.clsvideo3 {
		width: 49.5%;
		height: 49.5%;
	}

	.clsvideo {
		width: 33%;
	}

	.hauto {
		background: #121212;
		height: 100%;
	}

	.aliiton {
		width: 700rpx;
	}

	.zhongjiang {
		width: 50rpx;
		height: 140rpx;
		background: #5c5c5c;
		border-top-left-radius: 25rpx;
		border-bottom-left-radius: 25rpx;
	}

	.maxw {
		max-width: 400rpx;
		word-wrap: break-word;
		word-break: break-all;
	}

	.xinxia {
		border-top-right-radius: 15rpx;
		border-top-left-radius: 15rpx;
		border-bottom-left-radius: 15rpx;
	}

	.xinxias {
		border-top-right-radius: 15rpx;
		border-top-left-radius: 15rpx;
		border-bottom-right-radius: 15rpx;
	}

	.jingyin:hover {
		background: #165fff;
	}

	.sphoner:hover {
		background: #1e1e1e;
		border-left: 5px solid #165FFF;
	}

	.phoner:hover {
		border-left: 5px solid #165FFF;
	}

	.pcolode {
		border: 1px solid #165FFF;
	}

	.bixi {
		width: 2px;
		height: 21px;
		background: #383838;
		transform: rotate(-45deg);
	}

	.up {
		width: 0;
		height: 0;
		border-top: 0px solid transparent;
		border-right: 10px solid transparent;
		border-left: 10px solid transparent;
		border-bottom: 10px solid #fff;
		margin-top: -10px;
		margin-left: 75px;
	}

	.active {
		color: #165FFF;
	}

	.mkncs {
		/* 	width: 100vw;
		height: 86vh; */
		position: absolute;
		z-index: 10;
		left: 0;
	}

	.videocls {
		width: 100%;
		/* height: calc(400rpx - 72rpx); */
	}

	.xuanz {
		transform: rotate(180deg);
	}
	
	.chaindo {
		min-width: 10px;
		height:18px;
		border-radius: 18px;
		padding: 1px 4px;
	}

	.hoverpi:hover {
		color: #165fff;
	}

	.hover:hover {
		background: #e81123;
	}

	.hovers:hover {
		background: #becce3;
	}

	.voice-video {
		height: 180px;
		overflow: hidden;
	}

	.participationActive,
	.chatActive {
		background: #1E1E1E;
	}

	.posiab {
		position: absolute !important;
	}

	.rotate,
	.rotate1,
	.rotate2 {
		transform: rotate(180deg)
	}
</style>